<template>
  <div>
      <ul>
          <li v-for="item in arr" :key="item" v-show="isShow">
              {{item}}
            <button @click="dele(i)">删除</button>
          </li>
      </ul>
      <button @click="add">生成</button>
  </div>
</template>

<script>
export default {
data() {
    return {
        isShow:false,
        arr:[]
    }
},
methods:{
    add(){
        this.isShow=true;
        this.arr.push((Math.floor(Math.random()*100)));
    },
    dele(ind){
       this.arr.splice(ind,1)
    }
}
}
</script>

<style>

</style>